package cn.iocoder.yudao.module.call.dal.mysql.ivrflow;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.call.dal.dataobject.ivrflow.IvrFlowDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.call.controller.admin.ivrflow.vo.*;

/**
 * ivr流程 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface IvrFlowMapper extends BaseMapperX<IvrFlowDO> {

    default PageResult<IvrFlowDO> selectPage(IvrFlowPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IvrFlowDO>()
                .likeIfPresent(IvrFlowDO::getName, reqVO.getName())
                .eqIfPresent(IvrFlowDO::getGroupId, reqVO.getGroupId())
                .eqIfPresent(IvrFlowDO::getFlowData, reqVO.getFlowData())
                .eqIfPresent(IvrFlowDO::getStatus, reqVO.getStatus())
                .eqIfPresent(IvrFlowDO::getDesc, reqVO.getDesc())
                .betweenIfPresent(IvrFlowDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IvrFlowDO::getId));
    }

}